
#include "iostream"
#include "vector"
#include "unordered_map"
#include "algorithm"
#include "string"
#include "list"
class Solution{
public:
    std::list<int> l;
    void handle(int n){
        l.push_back(1);
        l.push_back(1);
        for(int i=2;i<=n;i++){
            auto begin=l.begin();
            while(1){
                auto end=l.end();
                end--;
                if(begin==end){
                    break;
                }
                auto num=*begin;
                auto bc=begin;
                bc++;
                if(*bc+*begin==i){
                    l.insert(bc,i);
                    begin++;
                }
                begin++;
            }
        }
        for(auto a:l){
            printf("%d",a);
        }
        printf("\n");
    }
};

int main() {
//    bool cur_num= true;
    int a=0;
    while(std::cin>>a){
        Solution s;
        s.handle(a);
    }
    return 0;
}

